package com.heima.wemedia;

import com.heima.audit.tess4j.Tess4jClient;
import net.sourceforge.tess4j.ITesseract;
import net.sourceforge.tess4j.Tesseract;
import org.junit.jupiter.api.Test;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
@SpringBootTest
public class Application {
    @Autowired
    Tess4jClient tess4jClient;

    @Test
    public  void ffo() {
        try {

            File file = new File("D:\\image\\image-1.png");//本地图片
            BufferedImage image=ImageIO.read(file);
            String result = tess4jClient.doOCR(image);
            System.out.println("识别的结果为："+result);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}